import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2023-03-21
 * Time: 16:10
 */
public class Main1 {
    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        String str1 = scanner.nextLine();
        String str2 = scanner.nextLine();
        Set<Character> hs = new HashSet<>();
        for (int i = 0; i < str2.length(); i++) {
            hs.add(str2.charAt(i));
        }
        final StringBuilder sb = new StringBuilder();
        for (int i = 0; i < str1.length(); i++) {
            if (!hs.contains(str1.charAt(i))) {
                sb.append(str1.charAt(i));
            }
        }
        System.out.println(sb.toString());
    }
}
